<?php
header("content-type:text/html;charset=utf-8");
include "../../public/config/config.php";
include("../../public/include/page.class.php");
$obj=new page($cfg_dbhost,$cfg_dbuser,$cfg_dbpwd,$cfg_dbname,$cfg_dbchar);
$type=$_REQUEST['type'];
$keyword=$_REQUEST['keyword'];
$arr=$obj->listData("callinfo",25,$type,$keyword);
$sel_arr[$type]="selected";
?>
<html>
	<head>
		<meta charset="UTF-8">
		<title>客户端访问记录</title>
		<style type="text/css">
			.tab{width: 80%;margin: 10 auto;}
			.tab table{width: 100%;}
			.tab td,h3{text-align: center;}
			#text_left1,#text_left2{text-align: left;}
			.tab td{max-width: 500px;word-wrap: break-word;}
		</style>
	</head>
	<body>
<div class="tab">
	<h3>客户端访问记录</h3>
	<form action="see_call.php" method="post">
		<select name="type">
			<option <?php echo $sel_arr['id']?> value="id">编号</option>
			<option <?php echo $sel_arr['tname']?> value="tname">真实姓名</option>
			<option <?php echo $sel_arr['uname']?> value="uname">用户名</option>
			<option <?php echo $sel_arr['ip']?> value="ip">客户IP</option>
			<option <?php echo $sel_arr['address']?> value="address">客户地址</option>
			<option <?php echo $sel_arr['pc_wap']?> value="pc_wap">客户设备</option>
			<option <?php echo $sel_arr['url']?> value="url">访问的网址</option>
			<option <?php echo $sel_arr['calltime']?> value="calltime">访问的时间</option>
		</select>
		关键字：<input type="text" name="keyword" value="<?php echo $keyword;?>" />
		<input type="submit" value="搜索"/>
	</form>
	<table border="1" cellspacing="0" cellpadding="0">
		<tr>
			<th>编号</th>
			<th>真实姓名</th>
			<th>用户名</th>
			<th>密码</th>
			<th>客户IP</th>
			<th>客户地址</th>
			<th>客户设备</th>
			<th>访问的页面</th>
			<th>访问的网址</th>
			<th>访问时间</th>
		</tr>
<?php
$pc_wap=array("PC端","wap端","其他");
foreach($arr as $v){
?>			
		<tr>
			<td><?php echo $v['id'];?></td>
			<td><?php echo $v['tname'];?></td>
			<td><?php echo $v['uname'];?></td>
			<td><?php echo $v['pwd'];?></td>
			<td><?php echo $v['ip'];?></td>
			<td><?php echo $v['address'];?></td>				
			<td><?php echo $pc_wap[$v['pc_wap']];?></td>
			<td id="text_left1"><?php echo $v['title'];?></td>
			<td id="text_left2"><?php echo $v['url'];?></td>
			<td><?php echo $v['calltime'];?></td>
		</tr>
<?php
}
?>	
		<tr>
			<td colspan="10">
				<?php echo $obj->showPage("see_call.php");?>
			</td>
		</tr>		
	</table>
</div>
	</body>
</html>